package com.cloudkinto.appletservice.user;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.appletservice.user.vo.*;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.UserDo;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-05-27
 */
public interface AppletUserService extends IService<UserDo> {

    SingleResult sendVerificationCode(String telPhone);

    /**
     * 用户登录并绑定
     *
     * @param req
     * @return
     */
    AppletUserLoginSuccessRes login(AppletUserLoginReq req);

    //根据用户名密码获取token
    SingleResult getToken(String username, String password);

    //退出登录
    void logout(LogOutReq logOutReq);

    //用户注册
    AppletUserRegisterReq register(AppletUserRegisterReq req);

    /**
     * 验证当前账户是否绑定
     *
     * @param code
     * @return
     */
    SingleResult appletAccountVerify(String code);


//    int updateUserInfo(AppletUserUpdateReq req);

    int updateUserInfoPhone(AppletUserUpdateReq req);

    int updateUserInfoMail(AppletUserUpdateReq req);

    int updateUserInfoName(AppletUserUpdateReq req);

    int updatePassword(AppletUpdatePasswordReq req);

    SingleResult detailInfo(Long id);

    String decryptData(AppletDecryptReq req) throws Exception;
}
